package sp.dao.user;

import java.util.Set;

import org.apache.ibatis.annotations.Param;

import sp.pojo.User;

public interface UserDao {
	
	/**
	 * 根据用户名查询用户
	 * @param typeCode
	 * @return
	 */
	public User findUserByUserName(@Param("typeCode")String typeCode);
	
	
	/**
	 * 根据用户查询角色标识符
	 * @param username
	 * @return
	 */
	public Set<String> findRoles(@Param("typeCode")String typeCode) throws Exception;
	  
	 
	/**
	 * 根据用户名查询权限标识符
	 * @param username
	 * @return
	 */
	public Set<String> findPermissions(@Param("typeCode")String typeCode) throws Exception;
	
	
	
	/**
	 * 新增用戶  用户-角色 1对1  创建时即确定角色
	 * @return
	 * @throws Exception
	 */
	public boolean saveUser(User user) throws Exception;
	
	
	
	/**
	 * 根据Id修改密码
	 * @param id
	 * @param newPassword
	 * @return
	 * @throws Exception
	 */
	public boolean modifyUser(User user) throws Exception;
	
	
	
	/**
	 * 删除用户
	 * @param uid
	 * @return
	 * @throws Exception
	 */
	public boolean deleteUser(@Param("uid") Integer uid) throws Exception;
	
	

	
}
